<?php

namespace App\Models;

use Encore\Admin\Traits\AdminBuilder;
use Encore\Admin\Traits\ModelTree;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class Teaching_plan extends Model
{
    use AdminBuilder, ModelTree {
        ModelTree::boot as treeBoot;
    }
	public $timestamps = false;
    protected $fillable = [
        'parent_id','order','title'
    ];

    // /**
    //  * @return array
    //  */
    // public function allNodes(){
    //     $connection = config('admin.database.connection') ?: config('database.default');
    //     $orderColumn = DB::connection($connection)->getQueryGrammar()->wrap($this->orderColumn);
    //     $byOrder = $orderColumn.' = 0,'.$orderColumn;
    //     $all = static::orderByRaw($byOrder)->get()->toArray();
	// 	return $all;
	// }
}
